package cn.edu.nchu.fragmentdemo.db.dao;

import android.content.Context;

import com.j256.ormlite.dao.Dao;

import cn.edu.nchu.fragmentdemo.bean.MarkerGroup;
import cn.edu.nchu.fragmentdemo.db.helper.ORMLiteHelper;

import java.sql.SQLException;

public class MarkerGroupDao {

    private static Dao<MarkerGroup, Integer> markerGroup;

    public static Dao<MarkerGroup, Integer> getmarkerGroupDao(Context context) {
        if (markerGroup == null) {
            synchronized (MarkerGroupDao.class) {
                if (markerGroup == null) {
                    try {
                        markerGroup = (Dao) ORMLiteHelper.getInstance(context).getDao(MarkerGroup.class);
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }
            }
        }
        return markerGroup;
    }
}
